/* ---------------------------------------------------------------------------
   This is a part of the ActivCard Samples. 
   Copyright (C) 2004 ActivCard Corp.
   All rights reserved. 

   This source code is only intended as a supplement to 
   ActivCard Development Tools and/or documentation.
   See these sources for detailed information regarding the 
   ActivCard samples programs.

   Disclaimer:
   ActivCard makes no representations or warranties with respect to the
   contents or use of this software, and specifically disclaims any express
   or implied warranties of merchantability or fitness for any particular
   purpose. Further, ActivCard reserves the right to revise this software
   and to make changes to its content, at any time, without obligation to
   notify any person or entity of such revisions or changes.
   Further, ActivCard makes no representations or warranties with 
   respect to any software, and specifically disclaims any express or 
   implied warranties of merchantability or fitness for any particular purpose.
--------------------------------------------------------------------------- */

#ifndef __SPLUTIL_H__
#define __SPLUTIL_H__ 1

#ifdef __cplusplus
extern "C" {
#endif

#if defined(WIN32)
/* Windows standard files and definitions */
#include <windows.h>
#else
/* Unix standard files and definitions */
#include <stdio.h>
#define CALLBACK
#define TRUE 1
#define FALSE 0
#endif


/***************/
/** CONSTANTS **/
/***************/


/**********************/
/** TYPE DEFINITIONS **/
/**********************/


/***************/
/** FUNCTIONS **/
/***************/

void GetString(
		const char *text,
		char *buffer,
		int buffer_size);

int LoadBuffer(
		char *file,
		char **buf);

int WriteBuffer(
		char *buf, 
		int buflen, 
		char *file);

int LoadSDB(
		SDB *pSDB, 
		char *filename);

void DumpSDB(
		SDB sdb, 
		int sdblen);

int SaveSDB(
		SDB *pSDB, 
		char *filename, 
		const char*pszKey);

int OverwriteSDB(
		const char *pszKey, 
		PSDB pSrcSDB, 
		PSDB pDestSDB);

#ifdef __cplusplus
}
#endif

#endif /* __SPLUTIL_H__ */
